﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.pp.processor.type.comm;
using SharpSqlAnalyzer.stmt;

namespace SharpSqlAnalyzer.pp.stmtformatter.type.comm
{
	// Token: 0x0200020F RID: 527
	public class PlsqlStmtFormatter : AbstractStmtFormatter
	{
		// Token: 0x0600122B RID: 4651 RVA: 0x003181E3 File Offset: 0x003163E3
		public virtual void addParameterProcessor(AbstractProcessor p)
		{
			if (this.parameterListProcessors == null)
			{
				this.parameterListProcessors = new List<AbstractProcessor>();
			}
			this.parameterListProcessors.Add(p);
		}

		// Token: 0x0600122C RID: 4652 RVA: 0x00318204 File Offset: 0x00316404
		public virtual void addDeclareProcessor(AbstractProcessor p)
		{
			if (this.declareProcessors == null)
			{
				this.declareProcessors = new List<AbstractProcessor>();
			}
			this.declareProcessors.Add(p);
		}

		// Token: 0x0600122D RID: 4653 RVA: 0x00318225 File Offset: 0x00316425
		public virtual void addBodyProcessor(AbstractProcessor p)
		{
			if (this.bodyProcessors == null)
			{
				this.bodyProcessors = new List<AbstractProcessor>();
			}
			this.bodyProcessors.Add(p);
		}

		// Token: 0x0600122E RID: 4654 RVA: 0x00318246 File Offset: 0x00316446
		public virtual void addBeginAndEndProcessor(AbstractProcessor p)
		{
			if (this.beginAndEndProcessors == null)
			{
				this.beginAndEndProcessors = new List<AbstractProcessor>();
			}
			this.beginAndEndProcessors.Add(p);
		}

		// Token: 0x0600122F RID: 4655 RVA: 0x00318268 File Offset: 0x00316468
		protected internal override void doFormat(TCustomSqlStatement stmtArg)
		{
			TStoredProcedureSqlStatement tstoredProcedureSqlStatement = stmtArg as TStoredProcedureSqlStatement;
			this.runProcessor<TStoredProcedureSqlStatement>(this.SpecialProcessors, tstoredProcedureSqlStatement);
			if (tstoredProcedureSqlStatement.ParameterDeclarations != null && tstoredProcedureSqlStatement.ParameterDeclarations.size() > 0)
			{
				this.runProcessor<TParameterDeclarationList>(this.parameterListProcessors, tstoredProcedureSqlStatement.ParameterDeclarations);
			}
			if (tstoredProcedureSqlStatement.BodyStatements != null && tstoredProcedureSqlStatement.BodyStatements.size() > 0)
			{
				this.runProcessor<TStatementList>(this.bodyProcessors, tstoredProcedureSqlStatement.BodyStatements);
			}
			if (tstoredProcedureSqlStatement.DeclareStatements != null && tstoredProcedureSqlStatement.DeclareStatements.size() > 0)
			{
				this.runProcessor<TStatementList>(this.declareProcessors, tstoredProcedureSqlStatement.DeclareStatements);
			}
		}

		// Token: 0x040013E2 RID: 5090
		private IList<AbstractProcessor> parameterListProcessors;

		// Token: 0x040013E3 RID: 5091
		private IList<AbstractProcessor> declareProcessors;

		// Token: 0x040013E4 RID: 5092
		private IList<AbstractProcessor> bodyProcessors;

		// Token: 0x040013E5 RID: 5093
		private IList<AbstractProcessor> beginAndEndProcessors;
	}
}
